package service

import (
	"context"
	"video-api/internal/model/entity"
	"video-api/internal/model/input"
	"video-api/internal/model/out"
)

type IOrderService interface {
	// GetOrderList 获取订单列表
	GetOrderList(ctx context.Context, list *input.OrderList) (res []*entity.Orders, count int, err error)
	// UnlockShortDrama 解锁短剧
	UnlockShortDrama(ctx context.Context, param *input.UnlockDrama) (*out.ShortDramaEpisodesEntity, error)
	// GetUnlockShortDramaList 查找短剧解锁列表
	GetUnlockShortDramaList(ctx context.Context, param *input.UnlockDramaList) ([]*entity.ShortDramaUnlocks, int, error)
	OrderCreate(ctx context.Context, params *input.OrderCreate) (*out.OrderEntity, error)
	OrderPay(ctx context.Context, params *input.OrderPay) (*out.OrderEntity, error)
}

var orderService IOrderService

func OrderService() IOrderService {
	if orderService == nil {
		panic("IOrderService is not initialized")
	}
	return orderService
}

func RegisterOrderService(s IOrderService) {
	orderService = s
}
